package com.kevin.executor;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.log4j.Logger;

public class ExecutorDemo {
	private static Logger logger = Logger.getLogger(ExecutorDemo.class);


	public static void main(String[] args) {
		try {
			long stime = System.currentTimeMillis();
			ExecutorService cachedThreadPool = Executors.newFixedThreadPool(100);
			cachedThreadPool.execute(new Thread(){
				public void run(){
					logger.info("------------------------------------");
				}
				
			});
			long etime = System.currentTimeMillis();
			cachedThreadPool.submit(new Thread(){
				public void run(){
					logger.info("------------------------------------");
				}
				
			});
			logger.info((etime-stime)/1000);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
		}

	}

}